package com.test21.nowcoder;

import java.util.HashSet;

public class FirstRepeat {
	public static void main(String[] args) {
		char findFirstRepeat = new FirstRepeat().findFirstRepeat("qywyer23tdd",11);
		System.out.println(findFirstRepeat);
	}
    public char findFirstRepeat(String A, int n) {
    	HashSet<Object> hashSet = new HashSet<>();
    	char tmp;
    	for (int i = 0; i < A.length(); i++) {
			tmp = A.charAt(i);
			if (!hashSet.add(tmp)) {
				return tmp;
			}
		}
    	return 'x';
    }
}